Using Connection Failover

Connection failover allows an application to connect to an alternate, or backup, SequeLink Server if the primary SequeLink Server is unavailable, for example, because of a hardware failure or traffic overload.

Refer to the SequeLink Administrator's Guide for more information about connection failover.

To configure connection failover to another server, you must specify a list of alternate database servers that are tried at connection time if the primary server is not accepting connections. To do this, use the Alternate Servers connection string option. Connection attempts continue until a connection is successfully established or until all the databases in the list have been tried once (the default).

Optionally, you can specify the following additional connection failover features:

You use a connection string to direct the .NET Client to use connection failover. See "Specifying Connection Options" for information about using connection strings.

The following C# code fragment includes a connection string that configures the .NET Client to use connection failover in conjunction with all of its optional features-load balancing, connection retry, and connection retry delay:

SequeLinkConnection Conn = new SequeLinkConnection(); 
Conn = new SequeLinkConnection("Host=server1;port=19996;ServerDataSource=
SDSN1:User ID=test;Password=secret;Alternate Servers=(Host=server2:Port=
19996:ServerDataSource=SDSN2,Host=server3:Port=19996:ServerDataSource=
SDSN3);Connection Retry Count=4;Connection Retry Delay=5;Load Balancing=true; 
Connection Timeout=60" 

Specifically, this connection string configures the .NET Client to use two alternate servers as connection failover servers, to attempt to connect four additional times if the initial attempt fails, to wait five seconds between attempts, and to try the primary and alternate servers in a random order. Each connection attempt lasts for 60 seconds.